var express = require('express'),
	cookieParser = require('cookie-parser'),
	encode = require('../pubModule/crypto'),
	check = require('../module/check'),
	index = express();

index.get('/',function(req, res){
	try{
		check.checkCookies(req.cookies.userName,
			encode.encrypto(req.session.userName),
			function(){
				res.render('index',{'user':req.session.userName})
			}, function(){
				res.render('index',{'user':''})
			});
	} catch(e) {
		res.render('index',{'user':''})
	}
})


module.exports = index;